#include <bits/stdc++.h>
using namespace std;

int tong[100005],a[100005];
int n;

int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	cin >> n;
	int maxn = -1;
	for (int i = 1;i <= n;i++){
		cin >> a[i];
		maxn = max(maxn,a[i]);
		tong[a[i]]++;
	}
	int ans = 0,tmp = 0;
	for (int i = 1;i <= maxn;i++){
		if (tong[i]){
			if (tmp - tong[i] < 0){
				ans += tmp;
				tmp = 0;
			}else tmp -= tong[i],ans += tong[i];
			tmp += tong[i];
		}
	}
	cout << n - ans;
	fclose(stdin);
	fclose(stdout);
	return 0;
}